<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            height: 9999px;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <script src="./jq.js"></script>
    <script>

        // 实现一个效果
        // 一秒之内 只能打印一次
        let runable = true;
        $(window).on('scroll', function () {
            if (!runable) {
                return;
            }
            runable = false;
            console.log($(document).scrollTop()); // 节奏很快的打印
            setTimeout(function () {
                runable = true;
            }, 1000);
        });

    </script>
</body>
</html>